//
//  APIClient.h
//  
//
//  Created by Mr Lemon.
//  Copyright (c) Fruity Solution 2013. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "AFHTTPClient.h"
#import "AFImageRequestOperation.h"
#import "ResponseObject.h"

//JSON Keys
#define kJSONSuccess					200
#define kJSONInternalNetworkError       500
#define kJSONParseError					-1
#define kJSONUnauthorizedError			401
#define kJSONForbiddenError				403
#define kJSONPaymentRequiredError		402
#define kJSONPreconditionFailedError	412
#define kJSONRequestTimeoutError		408
#define kJSONConflictError				409
#define kJSONBadRequestError			400
#define kJSONNotFoundError				404
#define kJSONNoInternetConnection       0

#define kJSONErrorKey					@"errors"
#define kJSONMessageKey					@"message"
#define kJSONDataKey					@"data"

@interface APIClient : AFHTTPClient

+ (APIClient *)sharedClient;

//Define all API functions here

- (void)registerPushNotification:(void (^)(ResponseObject *responseObject))block;
- (void)getVoucherDetail:(NSString*)voucherId
                    block:(void(^)(ResponseObject *responseObject))block;
- (void)sendDeviceToken:(NSString*)token isDev:(BOOL)isDev block:(void(^)(ResponseObject *responseObject))block;

@end
